/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package interact;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author UnderGround
 */
public class LoginInteraction {

    private static Connection conn;

    public static Vector getUserInfo(String sql) {
        conn = connect.connection();
        Vector vt = new Vector();
        if (conn == null) {
            ValidateData.showMessage("plz check your config");
        } else {

            try {
                ResultSet rs = interact.connect.createResultSet(sql);
                while (rs.next()) {

                    Vector temp = new Vector();
                    temp.add(rs.getString("UserID"));
                    temp.add(rs.getString("UserName"));
                    temp.add(rs.getString("Password"));
                    temp.add(rs.getString("FullName"));
                    temp.add(rs.getString("Phone"));
                    temp.add(rs.getString("Email"));
                    temp.add(rs.getString("BirthDay"));
                    temp.add(rs.getString("Gender"));
                    vt.add(temp);

                }
            } catch (SQLException ex) {
                Logger.getLogger(LoginInteraction.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        return vt;
    }
}
